/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.close.visitor.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.hopes.bizz.close.common.constant.enums.ParkCloseSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 访客进出申请
 *
 * @author pig
 * @date 2023-10-25 13:26:19
 */
@Data
@TableName(value = "closed_visitor_apply", excludeProperty = "tenantId")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "访客进出申请")
public class ClosedVisitorApplyEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;


	/**
	* ID
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="ID")
    private Long id;

	/**
	* 姓名
	*/
    @Schema(description="姓名")
    private String name;

	/**
	* 手机号
	*/
    @Schema(description="手机号")
    private String phone;

	/**
	* 身份证
	*/
    @Schema(description="身份证")
    private String idNum;

	/**
	 * 申请类型
	 */
	@Schema(description = "申请类型")
	private String applyType;

	/**
	 * 申请时间
	 */
	@Schema(description="申请时间")
	private Date applyTime;

	/**
	 * 访问时间
	 */
	@Schema(description="访问时间")
	private String visitTime;

	/**
	 * 有效时间
	 */
	@Schema(description="有效时间")
	private Date effectiveTime;

	/**
	 * 失效时间
	 */
	@Schema(description="失效时间")
	private Date invalidTime;

	/**
	 * 访问目的
	 */
	@Schema(description="访问目的")
	private Integer visitPurpose;

	/**
	 * 访问方式
	 */
	@Schema(description="访问方式")
	private Integer visitType;

	/**
	* 车牌号
	*/
    @Schema(description="车牌号")
    private String plateNo;

	/**
	* 门禁
	*/
    @Schema(description="门禁")
    private Long accessControlId;

	/**
	* 海康系统中的ID
	*/
    @Schema(description="海康系统中的ID")
    private String visitId;

	/**
	* 图片
	*/
    @Schema(description="身份证图片")
    private String idImg;

	/**
	* 备注
	*/
    @Schema(description="备注")
    private String remark;

	/**
	 * 审核状态
	 */
	@Schema(description="审核状态")
	private Integer auditStatus;

	/**
	 * 审核结果描述
	 */
	@Schema(description="审核结果描述")
	private String auditStatusDesc;

	/**
	 * 申请人Id
	 */
	@Schema(description="申请人Id")
	private Long applyUserId;

	/**
	 * 机构ID
	 */
	@Schema(description="机构ID")
	private Long orgId;


	public String getOrgIdStr() {
		return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.getOrgId());
	}

	public String getVisitTypeStr() {
		return DictResolver.getItemLabelByValue(ParkCloseSysDictEnum.close_visitor_type, this.getVisitType());
	}

	public String getVisitPurposeStr() {
		return DictResolver.getItemLabelByValue(ParkCloseSysDictEnum.close_visitor_purpose, this.getVisitPurpose());
	}


	public String getAuditStatusStr() {
		return DictResolver.getItemLabelByValue(ParkCloseSysDictEnum.close_visitor_audit_status, this.getAuditStatus());
	}



}
